home *** CD-ROM | disk | FTP | other *** search
- Path: galaxy.ucr.edu!not-for-mail
- From: thp@cs.ucr.edu (Tom Payne)
- Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
- Subject: Re: C/C++ knocks the crap out of Ada
- Followup-To: comp.lang.ada,comp.lang.c,comp.lang.c++
- Date: 4 Mar 1996 04:55:38 GMT
- Organization: University of California, Riverside
- Message-ID: <4hdt4a$ag9@galaxy.ucr.edu>
- References: <00001a73+00002504@msn.com> <4etcmm$lpd@nova.dimensional.com> <312515DF.7D3B@cmlj.demon.co.uk> <4gad29$ddp@druid.borland.com> <4gl72q$mo9@galaxy.ucr.edu> <4h1vt6$eks@druid.borland.com>
- NNTP-Posting-Host: corvette.ucr.edu
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
-
- Pete Becker writes:
- >
- > In article <4gl72q$mo9@galaxy.ucr.edu>, thp@cs.ucr.edu says...
- > [...]
- > >We are talking about a language whose
- > >syntax is so convoluted that, Dan Saks devoted over a hundred column
- > >inches of the January issue of C/C++ Users Journal to telling
- > >professional C/C++ programmers how to parse declarations. In the same
- > >issue, Pete Becker devoted space to explaining the meaning of
- > >sizeof(Sample&), which reads, "the number of bytes in the object
- > >representation for the type reference-to-Sample." That value turns
- > >out to be (get this!) the number of bytes used to encode objects of
- > >type Sample, regardless of the number of bytes used to encode
- > >references --- a design decision so obscure and irregular that even
- > >the authors of the April Draft of the C++ standard missed it.
- >
- > Yes, languages need to be explained, and sometimes have subtle points.
-
- I take some exception to this use of the word "subtle." If wRef is a
- Widget reference whose referent is w, then the subexpression wRef in
- the expression sizeof(wRef) denotes w, which is a Widget. So,
- technically, it is impossible to apply sizeof to an expression of type
- Widget reference, since such an expression spontaneously converts to
- type Widget when it is the arguement of sizeof, e.g., sizeof(wRef) IS
- sizeof(w). But, in the expression sizeof(Widget&), the subexpression
- Widget& does not denote Widget, so it is astonishing that
- sizeof(Widget&) should turn out to be sizeof(Widget) even when the
- object representations for the two types are quite different.
-
- Generally, the most natural extension of a concept is the one that
- requires the fewest changes to the wording of its definition,
- preferrably none. In this case, C++ violates that principle, yielding
- an anomalie that is bizarre, rather than "subtle."
-
- > That does not make any particular language "write only".
-
- The "write-only" epithet is obvious hyperbole; with sufficient
- practice, intelligent people can read almost anything (e.g., Hollerith
- codes and van Wjingaarden grammars) --- the issue is how much practice
- it takes. Some unfortunate design decisions have made C/C++
- considerably more difficult to read than necessary and, specifically,
- more difficult than Pascal, Modula, and Ada. The C/C++ Users Journal
- article by Dan Saks was both well-written and helpful. A similar
- article reviewing the basic syntax of type-forming expressions for a
- language with less convolute syntax would almost surely be viewed as
- unhelpful by similarly experienced programmers of that language.
-
- > >P.S. My students say that C is an in-joke that everyone now knows,
- > >while C++ is a shaggy dog whose punch line is STL.
- >
- > I would hope that you are teaching them critical analysis rather than analysis
- > by one-liners. Unfortunately, context-free assertions about the complexity of
- > C++ are not a useful base for a serious analysis. What are the alternatives,
- > and what, objectively, are the critical needs that those alternatives do not
- > answer?
-
- We try! Actually, the one-liners are a glib way of expressing
- judgments, not of arriving at them. C and C++ are the languages of
- choice for these students. Their exposure to Ada is mostly through
- its VHDL derivative, which is used heavily in our hardware courses.
-
- Tom Payne (thp@cs.ucr.edu)
-